#include<iostream>
#include<string.h>
#include<stdlib.h>
using namespace std;
int main()
{
	char s[100]="";
	gets(s);
	for(int i=0;i<strlen(s);i++)
	{
		if(s[i]==' '||s[i]==','||s[i]=='.'||s[i]=='?'||s[i]=='!'||s[i]=='"') {
		    if(s[i+1]!=' '&&s[i+1]!=','&&s[i+1]!='.'&&s[i+1]!='?'&&s[i+1]!='!'&&s[i+1]!='"') cout<<endl;
		    else continue;
		}
		else cout<<s[i];
	}
	return 0;
 } 
